/**
 *博尔信基础开发平台
 *<br> 版权声明：厦门博尔信软件有限公司版权所有,违者必究
 *<br> Copyright:  Copyright (c) 2012
 *<br> Company:pearlsoft
 *<br> @author 蒋勇华
 *<br> 2012-5-16
 *<br> @version 1.0
 *————————————————————————————————————
 *修改记录
 *    修改者：
 *    修改时间：
 *    修改原因：
 *——————————————————————————————————————
 */
package com.pearlsoft.webapp.rms.myres;

import java.util.List;

import com.pearlsoft.webapp.core.annotation.QueryHandlerComponent;
import com.pearlsoft.webapp.core.dataset.DataSet;
import com.pearlsoft.webapp.core.dataset.Query;
import com.pearlsoft.webapp.core.dataset.Record;
import com.pearlsoft.webapp.core.web.basehandler.AbsBaseQueryHandler;
import com.pearlsoft.webapp.core.web.session.SessionProfile;
import com.pearlsoft.webapp.core.web.util.HttpUtil;
import com.pearlsoft.webapp.rms.myres.service.MyResService;

/**
 *描述： 
 *
 * 
 */
@QueryHandlerComponent(name = "MyResQueryHandler")
public class MyResQueryHandler extends AbsBaseQueryHandler{

	public void queryGrid(Query query, DataSet ds) throws Exception {
		String userId = HttpUtil.getCookieValueByName(this.getHttpServletRequest(), SessionProfile.COOKIE_USERID);
		MyResService myResService = this.getBean("myResService", MyResService.class);
		List<Record> list = myResService.getMyResList(userId);
		ds.setRecords(list);
	}

	@Override
	public void handler(Query query, DataSet ds) throws Exception {
		
	}


	@Override
	public void getEntity(Query query, DataSet ds) throws Exception {
		String objId =(String) query.get("objId");
		MyResService myResService = this.getBean("myResService", MyResService.class);
		Record record=myResService.getById(objId);
		ds.addRecrod(record);
	}

	@Override
	public void quickSearch(Query query, DataSet ds) throws Exception {
		
	}


	@Override
	public void advSearch(Query query, DataSet ds) throws Exception {
		
	}
}
